﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Popup_Mat2.aspx.cs" Inherits="Popup_Popup_Mat2" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>제목 없음</title>
    <link href="../CustomCss.css" rel="stylesheet" type="text/css" />
    <link href="../resources/css/examples.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    .my-grid .x-grid3-scroller {
        overflow : scroll;
        }
    </style>
    <script type="text/javascript">       
       
       var CreateRow = function(){
            parent.SelectAddMat(document.getElementById("hdRowValue").value, "2");
            parent.Ext.getCmp('Window1').hide();
       }
              
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" />

    <ext:Panel ID="Panel1" runat="server" Title="" AnchorVertical="20%">
        <Content>
            <table>
                <tr>
                    <td style="width:8%;text-align:right;">업체명</td>
                    <td style="width:8%;">
                        <ext:TextField ID="tbxCustomer" runat="server" />
                    </td>
                    <td  style="width:8%;text-align:right;">자재명</td>
                    <td  style="width:8%;">
                        <ext:TextField ID="tbxMatName" runat="server" />
                    </td>
                    <td style="width:8%;text-align:right;">등록일</td>
                    <td>
                        <ext:DateField ID="dtFrom" runat="server" Vtype="daterange"  /> 
                    </td>
                    <td style="width:1%;">
                        ~
                    </td>
                    <td>
                        <ext:DateField ID="dtTo" runat="server" Vtype="daterange" />
                    </td>
                    <td style="width:3%;">
                        <ext:Button ID="btnSearch" runat="server" Text="조회" Icon="Zoom">
                            <DirectEvents>
                                <Click OnEvent="PopListSearch">
                                    <EventMask ShowMask="true" Msg="조회중입니다..." MinDelay="50" />
                                </Click>
                            </DirectEvents>
                        </ext:Button>
                    </td>
                    <td style="width:3%;">
                        <ext:Button ID="btnAdd" runat="server" Text="등록" Icon="Add">
                            <Listeners>
                                <Click Fn="CreateRow" />
                            </Listeners>
                        </ext:Button>
                    </td>
                </tr>
            </table>
        </Content>
    </ext:Panel>
    <p></p>
    <ext:GridPanel ID="GridPanel1" runat="server" AutoScroll="true" Cls="my-grid" Height="270">
        <Store>
            <ext:Store ID="Store1" runat="server">
                <Reader>
                    <ext:JsonReader>
                        <Fields>
                            <ext:RecordField Name="PROJ_CD" />
                            <ext:RecordField Name="BIZ_REGNO" />
                            <ext:RecordField Name="ITEM_CD" />
                            <ext:RecordField Name="O_CUST" />
                            <ext:RecordField Name="COMP_NM" />
                            <ext:RecordField Name="O_UC" />
                            <ext:RecordField Name="UNIT" />
                            <ext:RecordField Name="REG_DT" />
                            <ext:RecordField Name="REMARK" />
                            <ext:RecordField Name="NAME" />
                            <ext:RecordField Name="SPEC" />
                        </Fields>
                    </ext:JsonReader>
                </Reader>
                <Listeners>
                    <LoadException Handler="var e = e || {메시지: response.responseText}; alert('로드하지 못했습니다.: ' + e.message);" />
                </Listeners>
            </ext:Store>
        </Store>
        <View>
            <ext:GridView ID="GridView1" runat="server"/>
        </View>
        <ColumnModel ID="ColumnModel1" runat="server">
            <Columns>
                <ext:RowNumbererColumn />
                <ext:Column ColumnID="BIZ_REGNO" Header="" Width="60" DataIndex="BIZ_REGNO" Hidden="true" />
                <ext:Column ColumnID="COMP_NM" Header="업체명" Width="100" DataIndex="COMP_NM" />
                <ext:Column ColumnID="ITEM_CD" Header="코드" Width="100" DataIndex="ITEM_CD" />
                <ext:Column ColumnID="NAME" Header="자재명" Width="150" DataIndex="NAME" Align="Center" />
                <ext:Column ColumnID="SPEC" Header="규격" Width="100" DataIndex="SPEC" Align="Center" />
                <ext:Column ColumnID="UNIT" Header="단위" Width="70" DataIndex="UNIT" Align="Center" />
                <ext:Column ColumnID="O_UC" Header="단가" Width="100" DataIndex="O_UC" />
                <ext:Column ColumnID="REG_DT" Header="등록일" Width="100" DataIndex="REG_DT" />
                <ext:Column ColumnID="REMARK" Header="비고" Width="100" DataIndex="REMARK" />
            </Columns>
        </ColumnModel>
        <SelectionModel>
            <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true">
                <DirectEvents>
                    <RowSelect OnEvent="CreateParameter">
                        <ExtraParams>
                            <ext:Parameter Name="Values" Value="Ext.encode(#{GridPanel1}.getRowsValues({selectedOnly:true}))" Mode="Raw" />
                        </ExtraParams>
                    </RowSelect>
                </DirectEvents>
            </ext:RowSelectionModel>
        </SelectionModel>
        <TopBar>
            <ext:Toolbar ID="Toolbar1" runat="server">
                <Items>
                    <ext:Label ID="Label1" runat="server" Text="발주대상리스트">
                    </ext:Label>
                    <ext:ToolbarFill ID="ToolbarFill1" runat="server" />
                </Items>
            </ext:Toolbar>
        </TopBar>
    </ext:GridPanel>
        
    <ext:Hidden ID="hdRowValue" runat="server" />
    </form>
</body>
</html>
